#define _CRT_SECURE_NO_WARNINGS 
#include"Sell.h"
#include <cstddef>
void SLInit(SL* psl) {
	psl->a = NULL;
	psl->size = 0;
	psl->capacity = 4;
}
void SLDestroy(SL* psl) {
	if (psl->capacity != NULL) {
		free(psl->capacity);
		psl->a = NULL;
		psl->size = 0;
		psl->capacity = 0;
	}
}
void SLCheckCapacity(SL* psl) {
	if (psl->size == psl->capacity) {
		int newcapacity = psl->capacity = 0 ? 4 : sizeof(SLDataType) * psl->capacity;
		SLDataType* tmp = realloc(psl->a, sizeof(SLDataType) * newcapacity);
		if (tmp == NULL) {
			perror("failed relloc");
		}
		psl->a = tmp;
		psl->capacity = newcapacity;
	}

}
void SLpopback(SL* psl) {
	assert(psl);
	assert(psl->size > 0);
	psl->size--;
}
void SLpopfront(SL* psl) {

}
void SLpushback(SL* psl);
void SLpushfront(SL* psl);